package com.fzkj;

import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean;

/**
 * @DESCRIPTION: TODO
 * @AUTHOR: AnotherOne
 * @DATE: 2021/12/1 14:46
 */
public class ArrayTest {

    public static void main(String[] args) {
//        arrayTest();
//        map();
        List list = new ArrayList<>();
        list.add("1");
        list.add("2");
        list.add("3");
        AtomicBoolean success = new AtomicBoolean(false);
        list.forEach((item) -> {
            System.out.println(item);
            success.set(true);
        });
        System.out.println(success);
    }

    private static void map() {
        Map map = new HashMap<>();
        map.put("name", "1");
        map.put("age", "1");

        map.put("name", "2");
        map.put("age", "2");

        System.out.println(map.get("name"));
        System.out.println(map.get("age"));
    }

    private static void arrayTest() {
        String userNames[] = new String[]{"2222", "111"};
        System.out.println(Arrays.asList(userNames).contains("111"));
        System.out.println(Arrays.toString(userNames));
    }
}
